<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入 vue.js 文件 -->
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- 1.修饰符：lazy 只有回车或者失去焦点才能双向绑定 -->
        <input type="text" v-model.lazy="message">
        <h2>{{message}}</h2>

        <!-- 2.修饰符： number 自动转换成数字型-->
        <input type="number" v-model.number="age">
        <h2> {{age}}-{{typeof age}} </h2>

        <!-- 3. 修饰符：trim  自动去除两边空格-->
        <input type="text" v-model.trim="name">
        <h2> {{name}} </h2>
    </div>
    <script>
        new Vue({
            el: "#app",
            data: {
                message: "Hello Vue",
                age: 0,
                name: ''
            },
        });
    </script>
</body>

</html>